package cn.edu.buaa.cnsatm.traffic_big_data_server.waterway.controller;

import cn.edu.buaa.cnsatm.traffic_big_data_server.highway.service.HighwayTSService;
import cn.edu.buaa.cnsatm.traffic_big_data_server.waterway.dao.PortDAO;
import cn.edu.buaa.cnsatm.traffic_big_data_server.waterway.service.PortService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;

@RestController
public class PortController {
    @RequestMapping("/portCongestion")
    @ResponseBody
    public String highwayStatus(
            @RequestParam(value = "top_num", name = "top_num", required = true, defaultValue = "10") int top_num
    ) throws SQLException {
        /**
         * @author LX
         * @description 最拥挤的k个港口拥挤度
         * @date 2019-11-06
         */
        return PortService.getTopKPortCongestion(top_num);
    }
}
